fix(convert): MITgcm netCDF C-grid xgcm axes and coords for #2484#2555
Closed
amit221 wants to merge 2 commits intoParcels-code:mainfrom
Closed
fix(convert): MITgcm netCDF C-grid xgcm axes and coords for #2484#2555amit221 wants to merge 2 commits intoParcels-code:mainfrom
amit221 wants to merge 2 commits intoParcels-code:mainfrom
Conversation
…ode#2484 - Emit SGRID face_dimensions that map Xp1/Yp1 onto the xgcm X/Y axes when present (LOW padding keeps lon/lat on non-center positions for XGrid). - Accept Zl or depth in coords; set axis Z on depth when used. - Convert float model time to timedelta like croco_to_sgrid. Co-authored-by: Claude <noreply@anthropic.com>
Contributor
|
Hi @amit221 . Thanks for submitting a PR and for your interest in our project. I can't really make sense of your PR though, and given claude is a co-author on the commit I think that this is an autogenerated PR. Please be careful to follow our AI policy when submitting contributions. For this problem in particular (and in general when working in the I'm closing this. Let me know if you'd like to contribute to other areas. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes
convert.mitgcm_to_sgridfor MITgcm netCDF circulation-model data where velocity fields use C-grid staggered dimensionsXp1/Yp1(instead ofXC/YC). Previously,FieldSet.from_sgrid_conventionsfailed withValueError: Dimension "Xp1" has no axis attributebecause those dims were not wired to the xgcm X/Y axes after conversion.Changes:
face_dimensionsthat mapXp1/Yp1onto the xgcm X/Y axes when present (with LOW padding solon/latstay on the non-center positions expected byXGrid). Fall back to the existingXC/YC+ HIGH padding behavior whenXp1/Yp1are absent.Zlordepthin the coords subset (for workflows that rename cell-centerZtodepth); mapdepthto axis Z in_MITGCM_AXIS_VARNAMES._maybe_convert_time_from_float_to_timedeltafor MITgcm output, consistent withcroco_to_sgrid.test_convert_mitgcm_netcdf_circulation_model_to_fieldsetmirroring the issue snippet.How to test
From the repo root, with the
testpixi environment (see contributing docs):Optionally run the full convert tests:
Fixes #2484